import { ModuleWithProviders, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UserRoleComponent } from './user-role/user-role.component';
import { UserDetailComponent } from './user-detail/user-detail.component';
import { UserListComponent } from './user-list/user-list.component';
import { RefSelectRoleComponent } from './ref-select-role/ref-select-role.component';
import { RefSelectUserComponent } from './ref-select-user/ref-select-user.component';
import { RefRoleDetailComponent } from './ref-role-detail/ref-role-detail.component';
import { RefPermissionComponent } from './ref-permission/ref-permission.component';
import { IdentityRoutingModule } from './identity-routing.module';
import { IDENTITY_ROUTE_PROVIDERS } from './identity.route.provider';

import { CoreModule } from '@abp/ng.core';
import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzSpaceModule } from 'ng-zorro-antd/space';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzListModule } from 'ng-zorro-antd/list';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzCardModule } from 'ng-zorro-antd/card';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzAlertModule } from 'ng-zorro-antd/alert';
import { NzPaginationModule } from 'ng-zorro-antd/pagination';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { NzDrawerModule } from 'ng-zorro-antd/drawer';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { NzTreeViewModule } from 'ng-zorro-antd/tree-view';
import { NzTableModule } from 'ng-zorro-antd/table';

import { WidgetModule } from '../widget';

@NgModule({
  declarations: [
    UserRoleComponent,
    UserDetailComponent,
    UserListComponent,
    RefSelectRoleComponent,
    RefSelectUserComponent,
    RefRoleDetailComponent,
    RefPermissionComponent,
  ],
  imports: [
    CommonModule,
    IdentityRoutingModule,
    CoreModule,
    NzLayoutModule,
    NzGridModule,
    NzIconModule,
    NzButtonModule,
    NzSpaceModule,
    NzInputModule,
    NzListModule,
    NzFormModule,
    NzCardModule,
    NzCheckboxModule,
    NzModalModule,
    NzMessageModule,
    NzAlertModule,
    NzPaginationModule,
    NzTagModule,
    NzDividerModule,
    NzDrawerModule,
    NzTabsModule,
    NzTreeModule,
    NzTreeViewModule,
    NzTableModule,
    FormsModule,
    ReactiveFormsModule,
    WidgetModule,
  ],
})
export class IdentityModule {
  static forRoot(): ModuleWithProviders<IdentityModule> {
    return {
      ngModule: IdentityModule,
      providers: [IDENTITY_ROUTE_PROVIDERS],
    };
  }
}
